<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:jsf="http://xmlns.jcp.org/jsf">
    <head jsf:id="head">     
        <title>Search</title>
        <link href="css/meteocal.css" rel="stylesheet" type="text/css"/>
    </head>
    <body jsf:id="body" class="noFrame">   
        <!--Element of the first line on the top bar-->
        <div id="topHeader"> 
            <img id="logo" src="Images/meteocalsnow.png"  name="meteocalLogo" title="meteocallogo"/>
              
            <div class="logoutForm">         
                <h:form>
                    <p:commandButton value="Logout" action="#{loginBean.logout()}"/>                     
                </h:form>
            </div>
        </div>
        
        <div id="searchHeader">
            <h:form id="search">
                <p:inputText id="searchText" value="#{SearchController.searchedUser}" />
                <p:commandButton id="searchButton" value="Search"  action="#{SearchController.searchUser()}"/>    
            </h:form>   
        </div>
        
        <div id="LeftHeader">
            <ul class="buttonList">
                <h:form>
                    <li><p:commandButton class="leftBarButton"   value="Home" action="#{scheduleController.loadOwnCalendar()}"/></li>   
                    <li><p:commandButton class="leftBarButton"  value="AddEvent" action="#{EventController.newEvent}"/></li>    
                    <li><p:button class="leftBarButton"  value="Notifications" outcome="notifications"/></li>   
                    <li><p:button class="leftBarButton"  value="Settings" outcome="settings"/> </li> 

                </h:form>
            </ul>
        </div>

        <!-- Variable part -->

        <h1 style="margin-left: 33%">#{SearchController.found}</h1>
        <p:panelGrid id="searchGridHeader" layout="tabular" columns="3">
            <h:outputText value="USERNAME" />
            <h:outputText value="CALENDAR'S PRIVACY" />
            <h:outputText value="GO TO USER'S Calendar" />            

            <h:outputText value="#{SearchController.user.username}" />
            <h:outputText value="#{SearchController.user.calendar.privacy}" />
            <p:commandButton id="goToHome" disabled="#{SearchController.privateCalendar}" value="#{SearchController.user.username} 's Calendar"  action="#{scheduleController.loadPublicCalendar()}" />            
        </p:panelGrid>
        
        <p:dialog header="Error" widgetVar="UserNotFound Error" minHeight="40" resizable="false" >
        <h:outputText value="The User you searched is not registered in our application" />
        </p:dialog>
        
    </body>
</html>